home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Folders.a < prev    next >
Text File  |  1996-05-01  |  9KB  |  266 lines

  1. ;
  2. ;    File:        Folders.a
  3. ;
  4. ;    Contains:    Folder Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Some
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__FOLDERS__') = 'UNDEFINED' THEN
  19. __FOLDERS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__CODEFRAGMENTS__') = 'UNDEFINED' THEN
  25.     include 'CodeFragments.a'
  26.     ENDIF
  27.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  28.     IF &TYPE('__FILEMANAGERTYPES__') = 'UNDEFINED' THEN
  29.     include 'FileManagerTypes.a'
  30.     ENDIF
  31.     ENDIF
  32.     IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
  33.  
  34. kOnSystemDisk                    EQU        $8000
  35. kCreateFolder                    EQU        1
  36. kDontCreateFolder                EQU        0
  37. kSystemFolderType                EQU        'macs'                ; the system folder 
  38. kDesktopFolderType                EQU        'desk'                ; the desktop folder; objects in this folder show on the desk top. 
  39. kTrashFolderType                EQU        'trsh'                ; the trash folder; objects in this folder show up in the trash 
  40. kWhereToEmptyTrashFolderType    EQU        'empt'                ; the "empty trash" folder; Finder starts empty from here down 
  41. kPrintMonitorDocsFolderType        EQU        'prnt'                ; Print Monitor documents 
  42. kStartupFolderType                EQU        'strt'                ; Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here 
  43. kShutdownFolderType                EQU        'shdf'                ; Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here 
  44. kAppleMenuFolderType            EQU        'amnu'                ; Finder objects to put into the Apple menu go here 
  45. kControlPanelFolderType            EQU        'ctrl'                ; Control Panels go here (may contain INITs) 
  46. kExtensionFolderType            EQU        'extn'                ; Finder extensions go here 
  47. kFontsFolderType                EQU        'font'                ; Fonts go here 
  48. kPreferencesFolderType            EQU        'pref'                ; preferences for applications go here 
  49. kTemporaryFolderType            EQU        'temp'                ; temporary files go here (deleted periodically, but don't rely on it.) 
  50. ;
  51. ; pascal OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  52. ;
  53.     IF ¨ GENERATINGCFM THEN
  54.         Macro
  55.         _FindFolder
  56.             moveq               #0,D0
  57.             dc.w                $A823
  58.         EndM
  59.     ELSE
  60.         IMPORT_CFM_FUNCTION FindFolder
  61.     ENDIF
  62.  
  63. ;
  64. ; pascal OSErr ReleaseFolder(short vRefNum, OSType folderType)
  65. ;
  66.     IF ¨ GENERATINGCFM THEN
  67.         Macro
  68.         _ReleaseFolder
  69.             moveq               #11,D0
  70.             dc.w                $A823
  71.         EndM
  72.     ELSE
  73.         IMPORT_CFM_FUNCTION ReleaseFolder
  74.     ENDIF
  75.  
  76.     ENDIF
  77.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  78. ; ****************************************
  79. ;  Extensible Folder Manager declarations 
  80. ; ****************************************
  81. ; **************************
  82. ;  Folder Manager constants 
  83. ; **************************
  84. ;  new gestalt constants for gestalt FindFolderAttr (to be moved to Gestalt.h) 
  85.  
  86. gestaltFolderDescSupport        EQU        1                    ; has FolderDesc calls 
  87. ;  new Folder Manager error codes 
  88.  
  89. badFolderDescErr                EQU        -4270
  90. duplicateFolderDescErr            EQU        -4271
  91. noMoreFolderDescErr                EQU        -4272
  92. invalidFolderTypeErr            EQU        -4273
  93. duplicateRoutingErr                EQU        -4274
  94. routingNotFoundErr                EQU        -4275
  95. badRoutingSizeErr                EQU        -4276
  96.  
  97. kExtensionDisabledFolderType    EQU        'extD'
  98. kControlPanelDisabledFolderType    EQU        'ctrD'
  99. kSystemExtensionDisabledFolderType EQU    'macD'
  100. kApplicationsFolderType            EQU        'apps'
  101. kDocumentsFolderType            EQU        'docs'
  102.  
  103.                                                             ; new constants 
  104. kVolumeRootFolderType            EQU        'root'                ; root folder of a volume 
  105. kGlobalPreferencesFolderType    EQU        'gprf'                ; preferences for all users/workspaces 
  106. kChewableItemsFolderType        EQU        'flnt'                ; items deleted at boot 
  107. kApplicationSupportFolderType    EQU        'asup'                ; third-party items and folders 
  108. kSystem7SystemFolderType        EQU        '[f]blu'                ; System 7 system folder 
  109. kDebuggerExtensionsFolderType    EQU        '[f]deb'                ; debugger extensions 
  110. kDesktopModulesFolderType        EQU        '[f]dsk'                ; desktop animation modules 
  111. kEditorsFolderType                EQU        '[f]edi'                ; OpenDoc editors 
  112. kExtensionLibrariesFolderType    EQU        '[f]exl'                ; leechlets 
  113. kCoopExtensionLibrariesFolderType EQU    '[f]cex'                ; blue leechlets 
  114. kHardwareSupportFolderType        EQU        '[f]hdw'                ; hardware support 
  115. kLocalesFolderType                EQU        '[f]loc'                ; locales 
  116. kServerLibrariesFolderType        EQU        '[f]ser'                ; servers 
  117. kSystemLibrariesFolderType        EQU        '[f]sys'                ; system libraries 
  118. kTextEncodingsFolderType        EQU        '[f]tex'                ; encoding tables 
  119. kThemesFolderType                EQU        '[f]thm'                ; themes 
  120. kStationeryFolderType            EQU        '[f]stn'                ; stationery 
  121. ;  FolderDescFlags values 
  122.  
  123. kPersistentFolderDesc            EQU        $00000001
  124. kCreateFolderAtBoot                EQU        $00000002
  125. kFolderCreatedInvisible            EQU        $00000004
  126. kFolderCreatedNameLocked        EQU        $00000008
  127. ; typedef UInt32                         FolderDescFlags
  128.  
  129. ;  FolderClass values 
  130.  
  131. kRelativeFolder                    EQU        'relf'
  132. kSpecialFolder                    EQU        'spcf'
  133. ; typedef OSType                         FolderClass
  134.  
  135.  
  136. doReplace                        EQU        1
  137. dontReplace                        EQU        0
  138. ;  known FolderType values 
  139.  
  140. kBlessedFolder                    EQU        'blsf'
  141. kCurrentWorkspaceFolder            EQU        'cwsf'
  142. kRootFolder                        EQU        'rotf'
  143. kWorkspacesFolder                EQU        'wksf'
  144. ; typedef OSType                         FolderType
  145.  
  146. ; typedef OSType                         FolderLocation
  147.  
  148. FolderDesc                RECORD 0
  149. descSize                 ds.l    1                ; offset: $0 (0)
  150. foldType                 ds.l    1                ; offset: $4 (4)
  151. flags                     ds.l    1                ; offset: $8 (8)
  152. foldClass                 ds.l    1                ; offset: $C (12)
  153. foldLocation             ds.l    1                ; offset: $10 (16)
  154. badgeSignature             ds.l    1                ; offset: $14 (20)
  155. badgeType                 ds.l    1                ; offset: $18 (24)
  156. reserved                 ds.l    1                ; offset: $1C (28)
  157. name                     ds        Str63            ; offset: $20 (32)
  158. sizeof                     EQU *                    ; size:   $60 (96)
  159.                         ENDR
  160. ; typedef UInt32                         RoutingFlags
  161.  
  162. FolderRouting            RECORD 0
  163. descSize                 ds.l    1                ; offset: $0 (0)
  164. fileType                 ds.l    1                ; offset: $4 (4)
  165. routeFromFolder             ds.l    1                ; offset: $8 (8)
  166. routeToFolder             ds.l    1                ; offset: $C (12)
  167. flags                     ds.l    1                ; offset: $10 (16)
  168. sizeof                     EQU *                    ; size:   $14 (20)
  169.                         ENDR
  170. ;  routing constants 
  171.  
  172. kPersistentRouting                EQU        $00000001
  173. ; *************************
  174. ;  Folder Manager routines 
  175. ; *************************
  176. ;  Folder Manager administration routines 
  177. ;
  178. ; pascal OSErr AddFolderDescriptor(FolderType foldType, FolderDescFlags flags, FolderClass foldClass, FolderLocation foldLocation, OSType badgeSignature, OSType badgeType, Str63 name, Boolean replaceFlag)
  179. ;
  180.     IF GENERATINGCFM THEN
  181.         IMPORT_CFM_FUNCTION AddFolderDescriptor
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal OSErr GetFolderDescriptor(FolderType foldType, Size descSize, FolderDesc *foldDesc)
  186. ;
  187.     IF GENERATINGCFM THEN
  188.         IMPORT_CFM_FUNCTION GetFolderDescriptor
  189.     ENDIF
  190.  
  191. ;
  192. ; pascal OSErr GetFolderTypes(UInt32 requestedTypeCount, UInt32 *totalTypeCount, FolderType *theTypes)
  193. ;
  194.     IF GENERATINGCFM THEN
  195.         IMPORT_CFM_FUNCTION GetFolderTypes
  196.     ENDIF
  197.  
  198. ;
  199. ; pascal OSErr RemoveFolderDescriptor(FolderType foldType)
  200. ;
  201.     IF GENERATINGCFM THEN
  202.         IMPORT_CFM_FUNCTION RemoveFolderDescriptor
  203.     ENDIF
  204.  
  205. ;
  206. ; pascal OSErr FindFolderFSObject(FolderType foldType, Boolean createFolder, FSObjectRef *objectRef)
  207. ;
  208.     IF GENERATINGCFM THEN
  209.         IMPORT_CFM_FUNCTION FindFolderFSObject
  210.     ENDIF
  211.  
  212. ;
  213. ; pascal OSErr NewFindFolder(short vRefNum, FolderType foldType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  214. ;
  215.     IF GENERATINGCFM THEN
  216.         IMPORT_CFM_FUNCTION NewFindFolder
  217.     ENDIF
  218.  
  219. ;
  220. ; pascal OSErr InvalidateFolderDescriptorCache(short vRefNum, long dirID)
  221. ;
  222.     IF GENERATINGCFM THEN
  223.         IMPORT_CFM_FUNCTION InvalidateFolderDescriptorCache
  224.     ENDIF
  225.  
  226. ;  legacy routines 
  227. ;
  228. ; pascal OSErr GetFolderName(short vRefNum, OSType foldType, short *foundVRefNum, StringPtr name)
  229. ;
  230.     IF GENERATINGCFM THEN
  231.         IMPORT_CFM_FUNCTION GetFolderName
  232.     ENDIF
  233.  
  234. ;  routing routines 
  235. ;
  236. ; pascal OSErr AddFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType routeToFolder, RoutingFlags flags, Boolean replaceFlag)
  237. ;
  238.     IF GENERATINGCFM THEN
  239.         IMPORT_CFM_FUNCTION AddFolderRouting
  240.     ENDIF
  241.  
  242. ;
  243. ; pascal OSErr RemoveFolderRouting(OSType fileType, FolderType routeFromFolder)
  244. ;
  245.     IF GENERATINGCFM THEN
  246.         IMPORT_CFM_FUNCTION RemoveFolderRouting
  247.     ENDIF
  248.  
  249. ;
  250. ; pascal OSErr FindFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType *routeToFolder, RoutingFlags *flags)
  251. ;
  252.     IF GENERATINGCFM THEN
  253.         IMPORT_CFM_FUNCTION FindFolderRouting
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal OSErr GetFolderRoutings(UInt32 requestedRoutingCount, UInt32 *totalRoutingCount, Size routingSize, FolderRouting *theRoutings)
  258. ;
  259.     IF GENERATINGCFM THEN
  260.         IMPORT_CFM_FUNCTION GetFolderRoutings
  261.     ENDIF
  262.  
  263.     ENDIF
  264.     ENDIF ; __FOLDERS__ 
  265.  
  266.